<?php

namespace app\admin\controller\ai;

use app\common\controller\BaseController;
use hg\apidoc\annotation as Apidoc;
use \app\common\service\ai\OrderService;

/**
 * @Apidoc\Title("统计管理")
 * @Apidoc\Group("ai")
 * @Apidoc\Sort("300")
 */
class Stat extends BaseController {

    /**
     * @Apidoc\Title("首页")
     * @Apidoc\Returned("day", type="array", desc="当天数据", children={
     * @Apidoc\Returned("member_num", type="int", desc="注册会员数"),
     * @Apidoc\Returned("add_point", type="int", desc="充值点数"),
     * @Apidoc\Returned("reduce_point", type="int", desc="消耗点数"),
     * @Apidoc\Returned("video_point", type="int", desc="视频点数"),
     * @Apidoc\Returned("voice_point", type="int", desc="音频点数"),
     * })
     * @Apidoc\Returned("history", type="array", desc="历史数据", children={
     * @Apidoc\Returned("add_point", type="int", desc="充值点数"),
     * @Apidoc\Returned("reduce_point", type="int", desc="消耗点数"),
     * @Apidoc\Returned("video_point", type="int", desc="视频点数"),
     * @Apidoc\Returned("voice_point", type="int", desc="音频点数"),
     * })
     */
    public function index() {
        $list = OrderService::count($this->data);
        return success($list);
    }

}
